<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>13.Object.isPrototypeOf原型检测</title>
</head>

<body>
  <script>
    //使用isPrototypeOf检测一个对象是否是另一个对象的原型链中
    const a = {};
    const b = {};
    const c = {};

    Object.setPrototypeOf(a, b);
    Object.setPrototypeOf(b, c);

    console.log(b.isPrototypeOf(a)); //true
    console.log(c.isPrototypeOf(a)); //true
    console.log(c.isPrototypeOf(b)); //true
  </script>
</body>

</html>